<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<h:head>
	<title>Webcad - Locações Online</title>
	<link href="resources/css/estilo.css" rel="stylesheet" type="text/css" />

</h:head>

<h:body>

	<ui:include src="/topo_administrador.xhtml"></ui:include>


	<div class="clr"></div>

	<h:panelGroup>

		<div class="conteudo">


			<div class="clr"></div>

			<div class="panel panel-primary">

				<h4 class="panel-title">Triagem de Equipamento</h4>



				<h:form>
					<div class="left_home_adm">




						<label>Curso</label>
						<h:selectOneMenu id="tipoCurso" value="#{cursoBean.curso.id}">

							<f:selectItems value="#{cursoBean.cursos}" var="curso"
								itemLabel="#{curso.nome}" itemValue="#{curso.id}" />

						</h:selectOneMenu>

						<br />
						<h:commandButton class="btn btn-success"
							value="Buscar Equipamentos Alocados"
							action="#{equipamentoBM.equipamentosAlocados(cursoBean.curso.id)}" />










					</div>

					<div class="right_home">
						<h:dataTable id="TabelaDeEquipamentosParaTriagem"
							class="table bordered-table zebra-striped"
							value="#{equipamentoBM.tipoEquipamentos}" var="equipamento">

							<h:column>
								<f:facet name="header">
									<h:outputText value="Equipamento" />
								</f:facet>
								<h:outputText value="#{equipamento.nome}" />
							</h:column>

							<h:column>
								<f:facet name="header">
									<h:outputText value="Quant. Alocada" />
								</f:facet>

								<h:commandButton value="+" class="btn btn-info"
									action="#{equipamentoBM.alocarEquipamento(cursoBean.curso.id,equipamento.nome,false)}" />

								<h:outputText value="  #{equipamento.quantidadeAlocada}  " />

								<h:commandButton value="-" class="btn btn-info"
									action="#{equipamentoBM.alocarEquipamento(cursoBean.curso.id,equipamento.nome,true)}" />

							</h:column>


							<h:column>
								<f:facet name="header">
									<h:outputText value="Disponivel" />
								</f:facet>
								<h:outputText value="#{equipamento.quantidade}" />
							</h:column>




						</h:dataTable>
					</div>

				</h:form>
				<div class="clr"></div>


			</div>



		</div>


	</h:panelGroup>

	<ui:include src="rodape.xhtml"></ui:include>
</h:body>

</html>
